<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>监理服务系统</title>
    <!--公用样式-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/comment.css"/>
    <!--页面样式-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/style.css"/>
    <!--Layui-->
    <link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css" media="all"/>
    <!--页面样式-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/extended.css"/>
    <!--JQ-->
    <script type="text/javascript" charset="utf-8"
            src="${re.contextPath}/plugin/common/js/jquery-1.8.3.min.js"></script>
    <!--Layui-->
    <script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.js" charset="utf-8"></script>
    <!--公用样式JS-->
    <script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/comment.js"></script>
    <!--进度条-->
    <style>
        select {
            width: 70px;
        }

        .layui-tab-brief > .layui-tab-title .layui-this {
            color: #5775EF;
        }

        .layui-tab-brief > .layui-tab-more li.layui-this:after, .layui-tab-brief > .layui-tab-title .layui-this:after {
            border-bottom: 2px solid #5775EF;
        }

        .layui-laypage .layui-laypage-curr .layui-laypage-em {
            background-color: #5775EF;
        }
    </style>
</head>

<body>
<!--容器-->

<div class="container clearfix" style="height:800px;">

    <div class="Right  fr " style="width: 100%;height: 100%;">
        <!--个人信息-->
        <div class="myData myWork whitebg" style="height: 90%;overflow: auto;">

            <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief"
                 style=" padding-left: 0px; padding-right: 0px;">
                <input type="hidden" id="jztype" value="${jztype}">
                <ul class="layui-tab-title">
                    <li style="min-width: 130px;font-size: 20px; " lay-data="{'lcType': '6',index:'6'}">全部</li>
                    <li style="min-width: 130px;font-size: 20px; " lay-data="{'lcType': '0',index:'0'}">消息提醒</li>
                    <li style="min-width: 130px;font-size: 20px; " lay-data="{'lcType': '1',index:'1'}">待办事宜</li>
                    <li style="min-width: 130px;font-size: 20px;" lay-data="{'lcType': '2',index:'2'}">已办事宜</li>
                    <li style="min-width: 130px;font-size: 20px;" lay-data="{'lcType': '3',index:'3'}">办结事宜</li>
                    <li style="min-width: 130px;font-size: 20px;" lay-data="{'lcType': '4',index:'4'}">我的请求</li>
                    <#if "${jztype}"!='002'>
                        <li style="min-width: 130px;font-size: 20px;" lay-data="{'lcType': '5',index:'5'}">审批进程</li>
                    </#if>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <div class="myWorkBox processBox">
                            <div class="mt30 auto_min_height">
                                <ul>
                                </ul>
                            </div>
                            <div id="pageFy0"></div>
                        </div>
                    </div>
                    <div class="layui-tab-item  ">
                        <script type="text/html" id="barDemo">
                            <a class="cursor dodgerblue" lay-event="edit">查看详情</a>
                        </script>
                        <div class="toolbar-filter">
                            <div style="display: inline-block">
                                <span>接收人</span>
                                &nbsp;&nbsp;<input type="text" style="border:1px solid #DDDDDD;" name="receiveName" id="receiveName" placeholder="请输入接收人">
                            </div>
                            <div class="ml10" style="display: inline-block;">
                                <span>是否已读</span> &nbsp;&nbsp;
                                <select id="isView" placeholder="是否已读" name="isView" class="h30"
                                        style="width:200px" lay-ignore>
                                    <option value="">请选择</option>
                                    <option value="0">未读</option>
                                    <option value="1">已读</option>
                                </select>
                            </div>
                            <div class="ml10" style="display: inline-block;padding-left: 10px;">
                                <input type="button" class="layui-btn layui-btn-sm layui-btn-normal w90"
                                       style="margin-top: -5px;border-radius: 5px;" value="筛选" onclick="queryNotice()">
                                <input type="button" class="layui-btn layui-btn-sm w90"
                                       style="margin-top: -5px;border-radius: 5px;" value="重置"
                                       onclick="clearNoticeWhere()">
                            </div>
                        </div>
                        <div class="myWorkBox processBox">
                            <table id="stageList" class="layui-hide" lay-filter="stage"></table>
                        </div>
                    </div>
                    <div class="layui-tab-item  ">
                        <div class="myWorkBox processBox">
                            <div class="mt30 auto_min_height">
                                <ul>
                                </ul>
                            </div>
                            <div id="pageFy2"></div>
                        </div>
                    </div>
                    <div class="layui-tab-item">
                        <div class="myWorkBox processBox">
                            <div class="mt30 auto_min_height">
                                <ul>
                                </ul>
                            </div>
                            <div id="pageFy3"></div>
                        </div>
                    </div>
                    <div class="layui-tab-item">
                        <div class="myWorkBox processBox">
                            <div class="mt30 auto_min_height">
                                <ul>
                                </ul>
                            </div>
                            <div id="pageFy4"></div>
                        </div>
                    </div>
                    <div class="layui-tab-item">
                        <div class="myWorkBox processBox">
                            <div class="mt30 auto_min_height">
                                <ul>
                                </ul>
                            </div>
                            <div id="pageFy5"></div>
                        </div>
                    </div>
                    <div class="layui-tab-item">
                        <#if "${jztype}"!='002'>
                            <script type="text/html" id="barDemo">
                                <a class="cursor dodgerblue" lay-event="edit">查看详情</a>
                            </script>
                            <div class="toolbar-filter">
                                <div style="display: inline-block">
                                    <input class="pl10" type="text" placeholder="发起人姓名" width="300px;" name="fqName"
                                           id="fqName">
                                </div>
                                <div class="ml10" style="display: inline-block;">
                                    <select id="applicantType" placeholder="项目类型" name="applicantType" class="h30"
                                            style="width:200px" lay-ignore>
                                        <option value="">选择项目类型</option>
                                        <option value="001">监理</option>
                                        <option value="002">供需</option>
                                        <option value="003">咨询</option>
                                        <option value="004">检测</option>
                                    </select>
                                </div>
                                <div class="ml10" style="display: inline-block;">
                                    <input class="pl10" type="text" name="fqBeginDate" id="fqBeginDate"
                                           placeholder="发起开始日期">
                                    <span>ㅡ</span>
                                    <input class="pl10" type="text" name="fqEndDate" id="fqEndDate"
                                           placeholder="发起结束日期">
                                </div>
                                <div class="ml10" style="display: inline-block;padding-left: 10px;">
                                    <input type="button" class="layui-btn layui-btn-sm layui-btn-normal w90"
                                           style="margin-top: -5px;border-radius: 5px;" value="筛选" onclick="query()">
                                    <input type="button" class="layui-btn layui-btn-sm w90"
                                           style="margin-top: -5px;border-radius: 5px;" value="重置"
                                           onclick="clearWhere()">
                                </div>
                            </div>
                            <div class="myWorkBox processBox">
                                <table id="processList" class="layui-hide" lay-filter="processList"></table>
                            </div>
                        </#if>
                    </div>
                </div>
            </div>

        </div>
    </div>

</div>
<!--公用样式JS-->
<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js"></script>
<script type="text/javascript" src="${re.contextPath}/plugin/tools/cardUtils.js"></script>

<script type="text/html" id="toolBar">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看详情</a>
</script>
<script>
    var layer, form, laydate, upload, uploadListIns, element, tableIns, table, laypage;
    var layuiCurrPage = 1;
    $(function () {
        layui.use(['form', 'layer', 'element', 'table', 'laydate', 'laypage'], function () {
            laydate = layui.laydate;
            form = layui.form;
            element = layui.element;
            table = layui.table;
            laydate = layui.laydate;
            laypage = layui.laypage;
            //代办
            $('.layui-tab-title li').eq(1).click();
            innitNewNoticeTable();

        });


        $('.layui-tab-title li').on('click', function (i, v) {
            var that = $(this);
            var laydata = eval('(' + $(this).attr("lay-data") + ')');
            var lbType = laydata.lcType;
            var index = laydata.index;
            var jztype = '${jztype}';
            var url = "/affair/queryTaskList?jztype=" + jztype;
            var jsonc = {"lbType": lbType};
            if (index == 5) {
                innitProcessTable();
            }if (index == 1) {
                innitNewNoticeTable();
            } else {
                queryTask(url, jsonc, that, index);
            }

        });

    });

    function queryNotice() {
        table.reload('stageList', {
            where: {
                receiveName: $('#receiveName').val(),
                isView: $('#isView').val()
            }
        });
    }

    function clearNoticeWhere() {

        $('#receiveName').val('');
        $('#isView').val('');
        queryNotice();
    }
    function clearWhere() {
        $('#fqName').val('');
        $('#applicantType').val('');
        $('#fqBeginDate').val('');
        $('#fqEndDate').val('');
        query();
    }

    function query() {
        var json = {
            fqName: $('#fqName').val(),
            applicantType: $('#applicantType').val(),
            fqBeginDate: $('#fqBeginDate').val(),
            fqEndDate: $('#fqEndDate').val()
        };
        table.reload('processList', {
            where: {
                fqName: $('#fqName').val(),
                applicantType: $('#applicantType').val(),
                fqBeginDate: $('#fqBeginDate').val(),
                fqEndDate: $('#fqEndDate').val()

            }
        });
    }

    function innitProcessTable() {
        // 日期
        laydate.render({
            elem: '#fqBeginDate',
            trigger: 'click',
            format: 'yyyy-MM-dd'
        });
        laydate.render({
            elem: '#fqEndDate',
            trigger: 'click',
            format: 'yyyy-MM-dd'
        });
        table.render({
            id: 'processList',
            elem: '#processList',
            height: "550px",
            url: '/affair/queryProcessList',
            cols: [[
                {
                    title: '序号', width: '8%', templet: function (res) {
                        return res.LAY_INDEX;
                    }
                },
                {field: 'caseId', title: 'caseId', width: '7%', hide: true},
                {field: 'fqName', title: '发起人', width: '9%'},
                {
                    field: 'acceptTime',
                    title: '发起时间',
                    width: '12%',
                    sort: true,
                    templet: "<div>{{layui.util.toDateString(d.acceptTime,\'yyyy-MM-dd\')}}</div>"
                },
                {
                    field: 'applicantType', title: '项目类型', width: '10%', sort: true, templet: function (d) {
                        if (d.applicantType == "001") {
                            return '监理';
                        }
                        if (d.applicantType == "002") {
                            return '供需';
                        }
                        if (d.applicantType == "003") {
                            return '咨询';
                        }
                        if (d.applicantType == "004") {
                            return '检测';
                        }
                        if (d.applicantType == "000") {
                            return '系统';
                        }
                    }
                },
                {field: 'caseName', title: '项目名称', width: '20%'},
                {
                    field: 'lcType', title: '流程类型', width: '10%', sort: true, templet: function (d) {
                        if (d.lcType == "000") {
                            return '发布审核';
                        }
                        if (d.lcType == "001") {
                            return '审批';
                        }
                        if (d.lcType == "002") {
                            return '审核';
                        }
                        if (d.lcType == "003") {
                            return '监发两签';
                        }
                        if (d.lcType == "004") {
                            return '监发三签';
                        }
                        if (d.lcType == "005") {
                            return '承发三签';
                        }
                        if (d.lcType == "006") {
                            return '监理部门审核';
                        }
                        if (d.lcType == "010") {
                            return '咨询部门审核';
                        }
                        if (d.lcType == "011") {
                            return '咨询审核';
                        }
                        if (d.lcType == "012") {
                            return '咨询审批';
                        }
                        if (d.lcType == "013") {
                            return '咨发两签';
                        }
                        if (d.lcType == "014") {
                            return '检发两签';
                        }
                        if (d.lcType == "015") {
                            return '检测审核';
                        }
                        if (d.lcType == "016") {
                            return '检测审批';
                        }
                        if (d.lcType == "017") {
                            return '检测部门审核';
                        }
                    }
                },
                {field: 'taskName', title: '当前流程节点', width: '13%'},
                {field: 'userName', title: '节点操作人', width: '10%'},
                {
                    field: 'operDate',
                    title: '到达时间',
                    width: '12%',
                    sort: true,
                    templet: "<div>{{layui.util.toDateString(d.acceptTime,\'yyyy-MM-dd\')}}</div>"
                },
                {field: '操作', title: '操作', width: '10%', toolbar: '#barDemo'}

            ]],
            page: true,
            done: function (res, currentCount) {
                //***重点***：table渲染完成后渲染element进度条
                element.render()
            }
        });

        // 监听行工具事件
        table.on('tool(processList)', function (obj) {
            var data = obj.data;
            var caseId = data.caseId;
            var title = "";
            var w = "";
            var h = "";
            if (w == null || w == '') {
                w = ($(window).width());
            }
            ;
            if (h == null || h == '') {
                h = ($(window).height() - 50);
            }
            var url = "/supervisor/lcManager/processCheckDetail?caseId=" + caseId + "&lcType=5";
            parent.layer.open({
                id: 'form-add',
                type: 2,
                area: [w + 'px', h + 'px'],
                fix: false,
                maxmin: true,
                shadeClose: false,
                shade: 0.4,
                title: "查看详情",
                content: url,
                end: function () {
                    //刷新列表代办页面
                    // $('.layui-tab-title li').eq(index - 1).click();
                }
            });

        });
    }



    function innitNewNoticeTable() {

        // 日期
        laydate.render({
            elem: '#noticefqBeginDate',
            trigger: 'click',
            format: 'yyyy-MM-dd'
        });
        laydate.render({
            elem: '#noticefqEndDate',
            trigger: 'click',
            format: 'yyyy-MM-dd'
        });
        table.render({
            id: 'stageList',
            elem: '#stageList',
            url: '/project/projectManager/queryNoticeList',
            page: true,
            cols: [[
                {
                    title: '序号', width: '10%', align: 'center',totalRowText: '合计', templet: function (res) {
                        return res.LAY_INDEX;
                    }
                },
                {field: 'content', title: '消息', width:'28%', align: 'center',sort: false},
                {field: 'realName', title: '发起人', width: '10%',align: 'center', sort: false},
                {field: 'receiveName', title: '接收人', width: '10%',align: 'center', sort: false},
                {field: 'createDateStr', title: '发起时间', width: '20%',align: 'center', sort: false},
                {field: 'isView', title: '是否已读', width: '12%', sort: false,align: 'center', templet: function (d) {
                        if (d.isView=='1'){
                            return '已读'
                        }else{
                            return '<span style="color: red;">未读</span>';
                        }
                    } },
                {field: 'remark', title: '操作', width: '10%', align: 'center',toolbar: "#toolBarStage"}
            ]],
            done: function (res, currentCount) {
                //***重点***：table渲染完成后渲染element进度条
                element.render()
                //把有这个属性的 lay-event="LAYTABLE_COLS" 标签隐藏
                $("div[lay-event='LAYTABLE_COLS']").hide()
                $("div[lay-event='LAYTABLE_EXPORT']").hide()
                $("div[lay-event='LAYTABLE_PRINT']").hide()


            }
        });

        table.on('tool(stage)', function (obj) {
            console.log("mmmmmmmmmmmmmmmmmmmmmmmmmmmmm")
            var data = obj.data;
            if (obj.event === 'detailStage') {
                layer.alert('您所查看的项目阶段是：[<label style="color: #00AA91;">' + data.stageName + '</label>]')
            }
            if (obj.event === 'editStage') {

            }
            if (obj.event === 'delStage') {
                console.log(data,"=======================")
                layer.confirm('是否确定删除数据?', function () {
                    delStage(data.noticeId);
                });
            }
            if (obj.event === 'detail') {

                 var noticejson = {
                    noticeId:data.noticeId
                }
                layerAjax('/project/projectManager/updateNoticeStatus',noticejson, '',
                    function (d) {

                    });
                // 弹框显示消息内容的提示
                layer.open({
                    type: 1,
                    title: '消息内容',
                    area: ['600px', '400px'],
                    content: '<div style="padding: 20px;">' + data.content + '</div>',
                    btn: ['确定'],
                    yes: function (index, layero) {
                        layer.close(index);
                        queryNotice()
                    },
                    cancel: function (index, layero) {
                        queryNotice(); // 点击右上角的叉号时刷新列表
                    }
                });

            }
        })

        // table.render({
        //     id: 'processList',
        //     elem: '#processList',
        //     height: "550px",
        //     url: '/affair/queryProcessList',
        //     cols: [[
        //         {
        //             title: '序号', width: '8%', templet: function (res) {
        //                 return res.LAY_INDEX;
        //             }
        //         },
        //         {field: 'caseId', title: 'caseId', width: '7%', hide: true},
        //         {field: 'fqName', title: '发起人', width: '9%'},
        //         {
        //             field: 'acceptTime',
        //             title: '发起时间',
        //             width: '12%',
        //             sort: true,
        //             templet: "<div>{{layui.util.toDateString(d.acceptTime,\'yyyy-MM-dd\')}}</div>"
        //         },
        //         {
        //             field: 'applicantType', title: '项目类型', width: '10%', sort: true, templet: function (d) {
        //                 if (d.applicantType == "001") {
        //                     return '监理';
        //                 }
        //                 if (d.applicantType == "002") {
        //                     return '供需';
        //                 }
        //                 if (d.applicantType == "003") {
        //                     return '咨询';
        //                 }
        //                 if (d.applicantType == "004") {
        //                     return '检测';
        //                 }
        //                 if (d.applicantType == "000") {
        //                     return '系统';
        //                 }
        //             }
        //         },
        //         {field: 'caseName', title: '项目名称', width: '20%'},
        //         {
        //             field: 'lcType', title: '流程类型', width: '10%', sort: true, templet: function (d) {
        //                 if (d.lcType == "000") {
        //                     return '发布审核';
        //                 }
        //                 if (d.lcType == "001") {
        //                     return '审批';
        //                 }
        //                 if (d.lcType == "002") {
        //                     return '审核';
        //                 }
        //                 if (d.lcType == "003") {
        //                     return '监发两签';
        //                 }
        //                 if (d.lcType == "004") {
        //                     return '监发三签';
        //                 }
        //                 if (d.lcType == "005") {
        //                     return '承发三签';
        //                 }
        //                 if (d.lcType == "006") {
        //                     return '监理部门审核';
        //                 }
        //                 if (d.lcType == "010") {
        //                     return '咨询部门审核';
        //                 }
        //                 if (d.lcType == "011") {
        //                     return '咨询审核';
        //                 }
        //                 if (d.lcType == "012") {
        //                     return '咨询审批';
        //                 }
        //                 if (d.lcType == "013") {
        //                     return '咨发两签';
        //                 }
        //                 if (d.lcType == "014") {
        //                     return '检发两签';
        //                 }
        //                 if (d.lcType == "015") {
        //                     return '检测审核';
        //                 }
        //                 if (d.lcType == "016") {
        //                     return '检测审批';
        //                 }
        //                 if (d.lcType == "017") {
        //                     return '检测部门审核';
        //                 }
        //             }
        //         },
        //         {field: 'taskName', title: '当前流程节点', width: '13%'},
        //         {field: 'userName', title: '节点操作人', width: '10%'},
        //         {
        //             field: 'operDate',
        //             title: '到达时间',
        //             width: '12%',
        //             sort: true,
        //             templet: "<div>{{layui.util.toDateString(d.acceptTime,\'yyyy-MM-dd\')}}</div>"
        //         },
        //         {field: '操作', title: '操作', width: '10%', toolbar: '#barDemo'}
        //
        //     ]],
        //     page: true,
        //     done: function (res, currentCount) {
        //         //***重点***：table渲染完成后渲染element进度条
        //         element.render()
        //     }
        // });

        // 监听行工具事件
        table.on('tool(processList)', function (obj) {
            var data = obj.data;
            var caseId = data.caseId;
            var title = "";
            var w = "";
            var h = "";
            if (w == null || w == '') {
                w = ($(window).width());
            }
            ;
            if (h == null || h == '') {
                h = ($(window).height() - 50);
            }
            var url = "/supervisor/lcManager/processCheckDetail?caseId=" + caseId + "&lcType=5";
            parent.layer.open({
                id: 'form-add',
                type: 2,
                area: [w + 'px', h + 'px'],
                fix: false,
                maxmin: true,
                shadeClose: false,
                shade: 0.4,
                title: "查看详情",
                content: url,
                end: function () {
                    //刷新列表代办页面
                    // $('.layui-tab-title li').eq(index - 1).click();
                }
            });

        });
    }
    function queryTask(url, jsonc, that, index) {
        if (index == 6) {
            index = 0;
        } else {
            index = parseInt(index) + 1;
        }
        var indexpage = layer.load(1); //添加laoding,0-2两种方式
        layerAjaxGet(url, jsonc, '', function (d) {
            if (d.flag == true) {
                that.parent().next().find(".layui-tab-item").eq(index).find("ul").html("");
                var lcdata = d.data;
                pageFy(lcdata, index, that);
                layer.close(indexpage); //返回数据关闭loading
            } else {
                layer.close(indexpage); //返回数据关闭loading
                layer.msg(d.msg, {icon: 2});
            }
        });
    }

    function pageFy(data, index, that) {
        var index_v = index;
        laypage.render({
            elem: 'pageFy' + index_v
            , count: data.length
            , curr: layuiCurrPage
            , layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
            , jump: function (obj) {
                var jztype = '${jztype}';
                //模拟渲染
                that.parent().next().find(".layui-tab-item").eq(index_v).find("ul").html("");
                thisData = data.concat().splice(obj.curr * obj.limit - obj.limit, obj.limit);
                layui.each(thisData, function (index, item) {
                    var taskDate = item.taskDate;
                    var acceptTime = item.acceptTime;
                    var lcType = item.lcType;
                    var datetime = "";
                    if (index_v == 1 || index_v == 2) {
                        //代办取任务时间
                        datetime = taskDate;
                    } else {
                        datetime = acceptTime;
                    }
                    var caseId = item.caseId;

                    var caseName = item.caseName;
                    var businessId = item.businessId;
                    var caseId = item.caseId;
                    var applicantType = item.applicantType;
                    var noticeType = item.noticeType;
                    //任务名称
                    var taskName = item.taskName;
                    if(taskName){
                        // 去空格
                        taskName=taskName.replace(/ /g,'');
                    }
                    var applicantId = item.applicantId;
                    //业务类型 001 监理系统 002 咨询 003 检测
                    if (applicantType == "001") {
                        applicantType = "监理";
                    } else if (applicantType == "002") {
                        applicantType = "供需";
                    } else if (applicantType == "003") {
                        applicantType = "咨询";
                    } else if (applicantType == "004") {
                        applicantType = "检测";
                    }
                    var processInstanceId = item.processInstanceId;
                    var taskId = item.taskId;
                    var jsondata = {
                        caseId: caseId,
                        taskId: taskId,
                        taskName: taskName,
                        index_v: index_v,
                        businessId: businessId,
                        lcType: lcType,
                        applicantId: applicantId

                    }
                    if (item.pjType) {
                        jsondata.pjType = item.pjType;
                    }
                    if (noticeType) {
                        jsondata.noticeType = noticeType;
                    }
                    var json = JSON.stringify(jsondata);
                    var txbq = "";
                    if (index_v == "2") {//代办事项有红点提醒
                        txbq = "<b></b>"
                    } else if (index_v == "1") {
                        /*消息通知*/
                        var isView = item.isView;
                        if (isView == "0") {
                            txbq = "<b></b>"
                        } else {
                            txbq = "<span></span>"
                        }
                    } else {
                        txbq = "<span></span>"
                    }
                    that.parent().next().find(".layui-tab-item").eq(index_v).find("ul").append("    <li class=\"clearfix cursor-default\">\n" +
                        "                                        " + txbq + "\n" +
                        "                                        <div class=\"w90p\" ><span class=\"cursor ft16\" onclick=\"detailClick(this)\" lay-data=" + json + ">[" + datetime + "]" + caseName + "</span></div>\n" +
                        "                                        <span class=\"white\" style='background-color:#9B88EC;'>" + applicantType + "</span>\n" +
                        "                                    </li>");

                });
                if (jztype == '002') {
                    //隐藏
                    $('#pageFy' + index_v).css("display", "none");
                }
            },
            end: function () {
                console.log("endd.......")
            }
        });
        layuiCurrPage = 1;
    }

    function detailClick(object) {
        debugger;
        var that = $(".layui-this")
        var laydata = eval('(' + $(that).attr("lay-data") + ')');
        var index = laydata.index;
        var lcType = laydata.lcType;// 流程查看类型
        //if (index == 1) {
        //代办审核详情页面
        var title = "";
        var w = "";
        var h = "";
        if (w == null || w == '') {
            w = ($(window).width());
        }
        if (h == null || h == '') {
            h = ($(window).height() - 100);
        }
        var laydatajson = eval('(' + $(object).attr("lay-data") + ')');
        var caseId = laydatajson.caseId;
        var taskId = laydatajson.taskId;
        var taskName = laydatajson.taskName;
        var lclx = laydatajson.lcType;
        var url = "/supervisor/lcManager/processCheckDetail?caseId=" + caseId + "&taskId=" + taskId + "&lcType=" + lcType + "&taskName=" + encodeURI(taskName);
        if (laydatajson && laydatajson.noticeType && laydatajson.noticeType == '004') {
            var projId = laydatajson.businessId;
            if (projId) {
                layerAjaxGet('/supervisor/projectManager/checkExit', {id: projId}, undefined, function (res) {
                    if (res && res.flag) {
                        var projData = res.data;
                        localStorage.setItem('turntopageprjid', laydatajson.businessId);
                        localStorage.setItem('turntopageprjname', projData.projectName);
                        // parent.window.open('/supervisor/projectManager/index',"scrollbars=yes,resizable=1,modal=false,alwaysRaised=yes");
                        parent.window.open('/supervisor/projectManager/index');
                        return;
                    } else {
                        layer.msg("项目状态异常或已被删除!", {icon: 2});
                        return;
                    }
                })
            }
            return;
        }
        if (index == 0) {
            if (laydatajson.pjType) {
                /*服务评价*/
                var pjType = laydatajson.pjType;
                var evadata = {
                    spId: laydatajson.businessId,
                    source: "001"
                }
                if (pjType == "001") {
                    evadata.aindex = "1";
                    var data = JSON.stringify(evadata);
                    localStorage.removeItem("evadata");
                    localStorage.setItem("evadata", data);
                    /*对项目经理评价*/
                    url = ['/supervisor/projectManager/evaluationForm?caseId=' + caseId, 'no'];
                } else if (pjType == "002") {
                    evadata.aindex = "2";
                    var data = JSON.stringify(evadata);
                    localStorage.removeItem("evadata");
                    localStorage.setItem("evadata", data);
                    /*市场人员*/
                    url = ['/supervisor/projectManager/evaluationForm?caseId=' + caseId, 'no'];
                } else if (pjType == "011") {//咨询
                    evadata.aindex = "1";
                    var data = JSON.stringify(evadata);
                    localStorage.removeItem("evadata");
                    localStorage.setItem("evadata", data);
                    /*对项目经理评价*/
                    url = ['/zx/projectManager/evaluationForm?caseId=' + caseId, 'no'];
                } else if (pjType == "012") {//咨询
                    evadata.aindex = "2";
                    var data = JSON.stringify(evadata);
                    localStorage.removeItem("evadata");
                    localStorage.setItem("evadata", data);
                    /*市场人员*/
                    url = ['/zx/projectManager/evaluationForm?caseId=' + caseId, 'no'];
                } else if (pjType == "021") {//检测
                    evadata.aindex = "1";
                    var data = JSON.stringify(evadata);
                    localStorage.removeItem("evadata");
                    localStorage.setItem("evadata", data);
                    /*对项目经理评价*/
                    url = ['/jc/projectManager/evaluationForm?caseId=' + caseId, 'no'];
                } else if (pjType == "022") {//检测
                    evadata.aindex = "2";
                    var data = JSON.stringify(evadata);
                    localStorage.removeItem("evadata");
                    localStorage.setItem("evadata", data);
                    /*市场人员*/
                    url = ['/jc/projectManager/evaluationForm?caseId=' + caseId, 'no'];
                } else if (pjType == "032") {//检测
                    evadata.aindex = "3";
                    var data = JSON.stringify(evadata);
                    localStorage.removeItem("evadata");
                    localStorage.setItem("evadata", data);
                    /*业主单位*/
                    url = ['/jc/projectManager/evaluationForms?caseId=' + caseId, 'no'];
                }
            } else if ("101" == laydatajson.noticeType) {
                /**/
                url = "/supplier/projectManager/projectDetail?supProjectId=" + laydatajson.businessId + "&type=v&caseId=" + caseId;
                w = 1200;
                h = 600;
            } else if ("102" == laydatajson.noticeType) {
                /**/
                url = "/supplier/projectManager/changeDetail?supProjectChangeId=" + laydatajson.businessId + "&caseId=" + caseId;
                w = 1200;
                h = 600;
            } else if ("103" == laydatajson.noticeType) {
                /**/
                url = "/supplier/projectManager/projectDetail?supProjectId=" + laydatajson.businessId + "&type=v&contract=s&caseId=" + caseId;
                w = 1200;
                h = 600;
            } else if ("104" == laydatajson.noticeType) {
                /**/
                localStorage.removeItem("xfedit");
                localStorage.setItem("xfedit", laydatajson.businessId);
                localStorage.removeItem("caseId");
                localStorage.setItem("caseId", laydatajson.caseId);
                localStorage.removeItem("xmmc");
                localStorage.setItem("xmmc", laydatajson.taskName);
                parent.window.open('/supplier/index');
                return;
            } else if ("105" == laydatajson.noticeType) {
                /*外部发布的单位系统推荐中标人*/
                url = "/supplier/projectManager/projectDetail?supProjectId=" + laydatajson.businessId + "&type=v&tjconfirm=1&tjperson=" + laydatajson.applicantId + "&caseId=" + caseId;
                w = 1200;
                h = 600;
            } else if ("106" == laydatajson.noticeType) {
                /*内部发布项目进入议价*/
                url = "/supplier/projectManager/projectDetail?supProjectId=" + laydatajson.businessId + "&type=v&caseId=" + caseId;
                w = 1200;
                h = 600;
            } else if ("107" == laydatajson.noticeType) {
                /*内部发布项目系统推荐中标人*/
                url = "/supplier/projectManager/projectDetail?supProjectId=" + laydatajson.businessId + "&type=v&zbshr=s&tjperson=" + laydatajson.applicantId + "&caseId=" + caseId;
                w = 1200;
                h = 600;
            } else if ("108" == laydatajson.noticeType) {
                /*内部项目中标审核通过后 系统中标提示*/
                url = "/supplier/projectManager/projectDetail?supProjectId=" + laydatajson.businessId + "&type=v&caseId=" + caseId;
                w = 1200;
                h = 600;
            } else if ("109" == laydatajson.noticeType) {
                /*内部项目实施费用比例调整提示*/
                url = "/supplier/projectManager/projectDetail?supProjectId=" + laydatajson.businessId + "&type=v&caseId=" + caseId;
                w = 1200;
                h = 600;
            } else if ("110" == laydatajson.noticeType) {
                /*项目发布审核 通过 驳回 消息*/
                // url = "/supplier/projectManager/projectDetail?supProjectId=" + laydatajson.businessId+"&type=v&caseId="+caseId;
                // w=1200;
                // h=600;

                url = "/supervisor/lcManager/noticeDetail?caseId=" + caseId + "&lcType=" + lcType + "&taskName=" + encodeURI(taskName);
                w = 600;
                h = 300;

            } else if ("111" == laydatajson.noticeType) {
                /*个人信息审核通过*/
                url = "/supervisor/lcManager/noticeDetail?caseId=" + caseId + "&lcType=" + lcType + "&taskName=" + encodeURI(taskName);
                w = 600;
                h = 300;

            } else if ("112" == laydatajson.noticeType) {
                /*给 供需 其他审核人发布消息通知*/
                url = "/supervisor/lcManager/noticeDetail?caseId=" + caseId + "&lcType=" + lcType + "&taskName=" + encodeURI(taskName);
                w = 600;
                h = 300;

            } else if ("113" == laydatajson.noticeType) {
                /*基本信息修改后，给管理员发送消息*/
                url = "/supervisor/lcManager/noticeDetail?caseId=" + caseId + "&lcType=" + lcType + "&taskName=" + encodeURI(taskName);
                w = 600;
                h = 300;

            } else if ("114" == laydatajson.noticeType) {
                /*给考生发消息提示考试*/
                url = "/supervisor/lcManager/noticeDetail?caseId=" + caseId + "&lcType=" + lcType + "&taskName=" + encodeURI(taskName);
                w = 600;
                h = 300;

            }else {
                /**/
                url = "/supervisor/lcManager/noticeDetail?caseId=" + caseId + "&lcType=" + lcType + "&taskName=" + encodeURI(taskName);
                w = 1200;
                h = 600;
            }
        }
        parent.layer.open({
            id: 'form-add',
            type: 2,
            area: [w + 'px', h + 'px'],
            fix: false,
            maxmin: true,
            shadeClose: false,
            shade: 0.4,
            title: taskName,
            content: url,
            end: function () {
                if (index == '1' || index == '0') {
                    //刷新列表代办页面 消息通知
                    var recodePage = $(".layui-laypage-skip .layui-input").val();
                    var recodeLimit = $(".layui-laypage-limits").find("option:selected").val();
                    if (recodePage) {
                        layuiCurrPage = recodePage;
                    }
                    $('.layui-tab-title li').eq(parseInt(index) + 1).click();
                }
            }
        });

    }


</script>

<script type="text/html" id="toolBarStage">
    <a class="layui-btn  layui-btn-xs" lay-event="detail">查看</a>
</script>
</body>

</html>
